#include"DList.h"

void TestList()
{
	ListNode* list = NULL;
	list = ListInit(list);
	ListPushBack(list, 1);
	ListPushBack(list, 2);
	ListPushBack(list, 3);
	ListPushBack(list, 4);
	ListPushBack(list, 5);
	//ListPopBack(list);
	//ListPopBack(list);
	ListPrint(list);
}

void TestList2()
{
	ListNode* list = NULL;
	list = ListInit(list);
	//ListPushBack(list, 1);
	//ListPushBack(list, 2);
	//ListPushBack(list, 3);
	//ListdPopFront(list);
	//ListdPopFront(list);
	//ListdPopFront(list);
	ListPushFront(list, 19);
	ListPushFront(list, 1222);
	ListPushFront(list, 0);
	//ListdPopFront(list);

	printf("%p\n", ListFind(list, 19));
	// ListPushFront(list, 299);
	ListPrint(list);
}
void TestList3()
{
	ListNode* list = NULL;
	list = ListInit(list);
	ListPushBack(list, 1);
	ListPushBack(list, 2);
	ListPushBack(list, 3);
	
	ListPushBack(list, 4);

	ListNode* address = ListFind(list, 4);
	printf("find = %p\n", address);
	ListInsert(address, 1314);
	ListErease(address);
	ListPrint(list);
}
void TestList4()
{
	ListNode* list = NULL;
	list = ListInit(list);

	ListPushBack(list, 1);
	ListPushBack(list, 2);
	ListPushBack(list, 3);

	ListDistory(list);
	list = NULL;
}
int main()
{
	// TestList();
	// TestList2();
	// TestList2();
	TestList4();
	return 0;
}